package org.duiduo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.duiduo.common.bean.UserAddressVO;
import org.duiduo.common.bean.UserVO;
import org.duiduo.common.request.UserFindPageRequest;
import org.duiduo.entity.User;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
    // 一对多查询
    List<UserVO> findPage(UserFindPageRequest request);

    // 条数
    int total(UserFindPageRequest request);

    @Select("select count(id) count, address from user GROUP BY address")
    List<UserAddressVO> countAddress();
}
